
export class Operator{
    id?:number;
    operatorName?:string;
    tags?:number[];
    notUsed?:boolean;
    store?:Store;
    workShops?:WorkShop[]=[];
}
export class Process{
    id:number;
    processName:string;
    notUsed?:boolean;
    processSection:ProcessSection;
}
export class Manufacture{
    id?:number;
    manufactureName?:string;
    notUsed?:boolean;
    type?:ManufactureType;
    picUrls?:string[];
    descriptions?:string[];
    price?:number;
    spec?:string;
    note?:string;
    craft?:string;
    manufactureForm:ManufactureForm;
}
export type ManufactureType="FINISHED"|"SEMI";
export type CheckStataus="TO_BE_CHECK"|"QUALIFIED"|"DISQUALIFIED";
export class ProductionProcess{
    id:number;
    no?:string;
    item?:ManufactureItem;
    process?:Process;//@Deprecated
    startTime?:string;
    endTime?:string;
    liable?:Operator;
    processSection?:ProcessSection;
    expectStartTime?:string;
    expectEndTime?:string;
    workShop?:WorkShop;
    workers?:Operator[];
}
export class ProductionBill{
    id?:number;
    no?:string;
    item?:ManufactureItem;
    processes?:ProductionProcess[];
    liable?:Operator;
    author?:Operator;
    startTime?:string;
    endTime?:string;
    expectEndTime:string;
    createTime:string;
}
export class ManufactureItem{
    id:number;
    manufacture:Manufacture;
    quantity:number;
    price:number;
}
export class TimeSheet{
    id?:number;
    operator?:Operator;
    process?:Process;
    startTime:string;
    endTime:string;
    period:number;
    processTimes:ProcessTime[];
}

export class MaterialBill{
    id:number;
    no?:string;
    items:ManufactureItem[];
    founder:Operator;
    liables?:Operator[]=[];
    process?:ProductionProcess;
    createTime?:Date;
}

export class ProcessSection{
    id:number;
    processName:string;
    notUsed:boolean;
}

export class ReadableMessage {
    constructor(private advice: string,
                private toUser: boolean,
                private message?: string,
                private field?: string) {
    }
}

export class Store{
    id:number;
    storeName:string;
}

export class WorkShop extends Store {
    notUsed:boolean;
}

export class ManufactureEntry {
    id:number;
    store:Store;
    producer:Operator;
    inspector:Operator;
    receiver:Operator;
    createTime:Date;
    endTime:Date;
    manufactureItems:ManufactureItem[]=[];
    productionProcess:ProductionProcess;
    checkStatus:CheckStataus;
    checkReason:string;
    quantity:number;
}

export class TransferEntry {
    id:number;
    applicant:Operator;
    receiver:Operator;
    manufactureItems:ManufactureItem[]=[];
    createTime:Date;
    endTime:Date;
    accept:boolean;
    originStore:Store;
    targetStore:Store;
}

export class Stock {
    id?:number;
    manufacture?:Manufacture ;
    store?:Store ;
    quantity:number;
    price:number;
    flag:number;
    intoNum:number;
    outNum:number;
}

export class ProcessTime {
    id:number;
    productionProcess:ProductionProcess;
    minute:number;
    stockAlterations?:StockAlteration[]=[];
}

export class StockAlteration  {
    id:number;
    quantity:number;
    flag?:number;
    manufacture:Manufacture;
    store;
}

export class ManufactureForm {
    id: number;
    name: string;
}
